package org.example.factoryPattern;

/**
 * @author LiXingShuai
 * @className PhoneFactoryTest
 * @description: 手机工厂创建手机
 * @date 2023年04月16日
 * @version: 1.0
 */
public class PhoneFactoryTest {

    public static void main(String[] args) {
        PhoneFactory phoneFactory = new PhoneFactory();
        HuaWei huaWei = (HuaWei) phoneFactory.createPhone("huawei");
        System.out.println(huaWei.brand());

        IPhone iPhone = (IPhone) phoneFactory.createPhone("iphone");
        System.out.println(iPhone.brand());
    }

}
